<template>
	<view>
		<view class="view-sty">
			{{text}}
		</view>
		<view class="input-pass">
			<u--input placeholder="请设置8 - 32位(数字+字母)" border="bottom" v-model="newPassword" password clearable></u--input>
		</view>
		<view class="u-page__button-item">
			<u-button text="保存新密码" size="normal" type="primary" @click="upPassword"></u-button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				text: '',//头部文本
				phone: '',//电话号
				newPassword: ''//新密码
			}
		},
		//页面跳转接收参数
		onLoad(options) {
			this.phone = options.phone
			this.text = "请为你的账号 +86" + this.phone + "设置一个新密码"
		},
		methods: {
			//修改密码
			upPassword(){
				this.$myRequest({
					url:'/rider/updatePassword',
					method:'get',
					data:{
						'phone':this.phone,
						'newPassword':this.newPassword
					}
				}).then(res=>{
					uni.navigateTo({
						url: '/pages/login/passwordLogin',
					})
				})
			}
		}
	}
</script>

<style>
	.view-sty {
		font-size: 15px;
		margin-top: 125rpx;
		margin-left: 65rpx;
	}
	.input-pass{
		width: 600rpx;
		margin-left: 50rpx;
		margin-top: 100rpx;
	}
	.u-page__button-item {
		width: 600rpx;
		margin-left: 50rpx;
		margin-top: 60rpx;
	}
</style>
